//
//  UtilsConfigModel.m
//  WKWebVIewDemo
//
//  Created by Yonger on 2018/7/19.
//  Copyright © 2018年 WKWebView. All rights reserved.
//

#import "UtilsConfigModel.h"
#import <UIKit/UIKit.h>

@implementation UtilsConfigModel

+(BOOL)isOrientationPortrait{
    UIInterfaceOrientation interface = [UIApplication sharedApplication].statusBarOrientation;
    if (interface == UIInterfaceOrientationLandscapeLeft || interface == UIInterfaceOrientationLandscapeRight) {// 横屏
        return NO;
    }
    return YES;
}

+ (NSString *)getString:(NSDictionary*)dict key:(id)key{
    NSString *string = @"";
    if (dict && [dict objectForKey:key]) {
        string = [NSString stringWithFormat:@"%@",[dict objectForKey:key]];
    }
    if (string == nil || [string isBlankString]) {
        string = @"";
    }
    return string;
}

+(void)loadingViewShowInView:(UIView*)view content:(NSString*)content{
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
    hud.labelText = content;
    hud.removeFromSuperViewOnHide = YES;
    hud.animationType   = MBProgressHUDAnimationZoomOut;
}
+(void)loadingViewDismissFromView:(UIView*)view{
    [MBProgressHUD hideHUDForView:view animated:YES];
}

@end
